package study.java.jdk.jdk8._1_stream.intermediate;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 跳过前n个元素，返回剩余的元素，若流中元素不足n个，则返回空流
 */
@Slf4j
public class skip_Test {

    @Test
    public void test1() {
        List<String> src = Arrays.asList("s2_switch", "efg", "123", "s2_switch");
        List<String> dest = src.stream()
                .skip(8)
                .collect(Collectors.toList());
        log.info("{}", dest);
    }
}
